package fpzhan.plane.program.compose;

import fpzhan.plane.program.util.StringUtils;

import java.util.List;

public class ComposeContent {

    public List<String> belongToSignName;

    public boolean repeatFirst;
    public boolean repeatLast;


    private String signName;

    private Integer repeatTime;

    private String signComment;

    private String repeatComment;

    private Class exceptionClass;


    public ComposeContent(Class exceptionClass) {
        this.exceptionClass = exceptionClass;
    }

    public ComposeContent(List<String> belongToSignName) {
        this.belongToSignName = belongToSignName;
    }

    public ComposeContent(boolean repeatFirst, boolean repeatLast) {
        this.repeatFirst = repeatFirst;
        this.repeatLast = repeatLast;
    }

    public ComposeContent(boolean repeatFirst, boolean repeatLast, String signName, Integer repeatTime, String signComment, String repeatComment) {
        this.repeatFirst = repeatFirst;
        this.repeatLast = repeatLast;
        this.signName = signName;
        this.repeatTime = repeatTime;
        this.signComment = signComment;
        this.repeatComment = repeatComment;
    }

    public ComposeContent extend(ComposeContent content){
        if (content!=null && content.isRepeat()){
            this.signName=content.signName;
            this.repeatTime=content.repeatTime;
            this.signComment=content.signComment;
            this.repeatComment=content.repeatComment;
        }
        return this;
    }

    public boolean isRepeat(){
        if(StringUtils.isNotEmpty(this.signName)){
           return true;
        }else{
            return false;
        }
    }

    public boolean isRepeatLast() {
        return repeatLast;
    }

    public void setRepeatLast(boolean repeatLast) {
        this.repeatLast = repeatLast;
    }

    public String getSignName() {
        return signName;
    }

    public void setSignName(String signName) {
        this.signName = signName;
    }

    public Integer getRepeatTime() {
        return repeatTime;
    }

    public void setRepeatTime(Integer repeatTime) {
        this.repeatTime = repeatTime;
    }

    public String getSignComment() {
        return signComment;
    }

    public void setSignComment(String signComment) {
        this.signComment = signComment;
    }

    public String getRepeatComment() {
        return repeatComment;
    }

    public void setRepeatComment(String repeatComment) {
        this.repeatComment = repeatComment;
    }

    public boolean isRepeatFirst() {
        return repeatFirst;
    }

    public void setRepeatFirst(boolean repeatFirst) {
        this.repeatFirst = repeatFirst;
    }

    public List<String> getBelongToSignName() {
        return belongToSignName;
    }

    public void setBelongToSignName(List<String> belongToSignName) {
        this.belongToSignName = belongToSignName;
    }
}
